﻿using MediatR;
using T.Personnel.Domain;
using T.Personnel.Domain.Dto;
using T.Personnel.Read.API.Application.Command.ResignationManageCommand;
using T.Personnel.Repository.Interface;

namespace T.Personnel.Read.API.Application.CommandHandler.ResignationManageHandler
{
    public class GetAllResignationHandler : IRequestHandler<GetAllResignationCommand, List<Manage>>
    {
        private readonly IManageRepository manageRepository;

        public GetAllResignationHandler(IManageRepository manageRepository)
        {
            this.manageRepository = manageRepository;
        }

        public async Task<List<Manage>> Handle(GetAllResignationCommand request, CancellationToken cancellationToken)
        {
            return await manageRepository.GetAllResignationAsync();
        }
    }
}
